function IncomeRecord(params){ 
	 
}

IncomeRecord.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new IncomeRecord.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new IncomeRecord.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new IncomeRecord.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
		
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
		
		
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
		 
	
	
	/** 用户身份    1:普通会员 2:代理 3:合伙人     **/
	this.userType=function(userType){if(this.proxy)return this.getProxy().userType(userType);  this.put("userType", userType);return this;};
	/** and user_type is null */
	this.userTypeNull=function(){if(this.proxy)return this.getProxy().userTypeNull();if(this.get("userTypeNot")==null)this.put("userTypeNot", "");this.put("userType", null);return this;};
	/** not .... */
	this.userTypeNot=function(){if(this.proxy)return this.getProxy().userTypeNot();this.put("userTypeNot", "not");return this;};
	this.userTypeNotNull=function(){if(this.proxy)return this.getProxy().userTypeNotNull();this.put("userTypeNot", "not");this.put("userType", null);return this;};
	this.userTypeNot=function(userType){if(this.proxy)return this.getProxy().userTypeNot(userType);this.put("userTypeNot", "not");this.put("userType", userType);return this;};
		
		
	this.userTypeIn=function(ids){
		if(this.proxy)return this.getProxy().userTypeIn(ids);  this.put("userTypeIn", ids);return this;
	};	
		 
	
	
	/** 来源    1:直接购买 2:余额充值 3:代理卡购买 4:合伙人卡购买     **/
	this.source=function(source){if(this.proxy)return this.getProxy().source(source);  this.put("source", source);return this;};
	/** and source is null */
	this.sourceNull=function(){if(this.proxy)return this.getProxy().sourceNull();if(this.get("sourceNot")==null)this.put("sourceNot", "");this.put("source", null);return this;};
	/** not .... */
	this.sourceNot=function(){if(this.proxy)return this.getProxy().sourceNot();this.put("sourceNot", "not");return this;};
	this.sourceNotNull=function(){if(this.proxy)return this.getProxy().sourceNotNull();this.put("sourceNot", "not");this.put("source", null);return this;};
	this.sourceNot=function(source){if(this.proxy)return this.getProxy().sourceNot(source);this.put("sourceNot", "not");this.put("source", source);return this;};
		
		
	this.sourceIn=function(ids){
		if(this.proxy)return this.getProxy().sourceIn(ids);  this.put("sourceIn", ids);return this;
	};	
		 
	
	
	/** 收益类型    1:直接 2:间接     **/
	this.revenueType=function(revenueType){if(this.proxy)return this.getProxy().revenueType(revenueType);  this.put("revenueType", revenueType);return this;};
	/** and revenue_type is null */
	this.revenueTypeNull=function(){if(this.proxy)return this.getProxy().revenueTypeNull();if(this.get("revenueTypeNot")==null)this.put("revenueTypeNot", "");this.put("revenueType", null);return this;};
	/** not .... */
	this.revenueTypeNot=function(){if(this.proxy)return this.getProxy().revenueTypeNot();this.put("revenueTypeNot", "not");return this;};
	this.revenueTypeNotNull=function(){if(this.proxy)return this.getProxy().revenueTypeNotNull();this.put("revenueTypeNot", "not");this.put("revenueType", null);return this;};
	this.revenueTypeNot=function(revenueType){if(this.proxy)return this.getProxy().revenueTypeNot(revenueType);this.put("revenueTypeNot", "not");this.put("revenueType", revenueType);return this;};
		
		
	this.revenueTypeIn=function(ids){
		if(this.proxy)return this.getProxy().revenueTypeIn(ids);  this.put("revenueTypeIn", ids);return this;
	};	
		 
	
	
	/** 贡献收益        **/
	this.income=function(income){if(this.proxy)return this.getProxy().income(income);  this.put("income", income);return this;};
	/** and income is null */
	this.incomeNull=function(){if(this.proxy)return this.getProxy().incomeNull();if(this.get("incomeNot")==null)this.put("incomeNot", "");this.put("income", null);return this;};
	/** not .... */
	this.incomeNot=function(){if(this.proxy)return this.getProxy().incomeNot();this.put("incomeNot", "not");return this;};
	this.incomeNotNull=function(){if(this.proxy)return this.getProxy().incomeNotNull();this.put("incomeNot", "not");this.put("income", null);return this;};
	this.incomeNot=function(income){if(this.proxy)return this.getProxy().incomeNot(income);this.put("incomeNot", "not");this.put("income", income);return this;};
		
	/** and income <= ? */
	this.incomeMin=function(min){if(this.proxy)return this.getProxy().incomeMin(min);this.put("incomeMin", min);return this;};
	/** and income >= ? */
	this.incomeMax=function(max){if(this.proxy)return this.getProxy().incomeMax(max);this.put("incomeMax", max);return this;};
		
		 
	
	
	/** 头像        **/
	this.headPortrait=function(headPortrait){if(this.proxy)return this.getProxy().headPortrait(headPortrait);  this.put("headPortrait", headPortrait);return this;};
	/** and head_portrait is null */
	this.headPortraitNull=function(){if(this.proxy)return this.getProxy().headPortraitNull();if(this.get("headPortraitNot")==null)this.put("headPortraitNot", "");this.put("headPortrait", null);return this;};
	/** not .... */
	this.headPortraitNot=function(){if(this.proxy)return this.getProxy().headPortraitNot();this.put("headPortraitNot", "not");return this;};
	this.headPortraitNotNull=function(){if(this.proxy)return this.getProxy().headPortraitNotNull();this.put("headPortraitNot", "not");this.put("headPortrait", null);return this;};
	this.headPortraitNot=function(headPortrait){if(this.proxy)return this.getProxy().headPortraitNot(headPortrait);this.put("headPortraitNot", "not");this.put("headPortrait", headPortrait);return this;};
		
		 
	
	
	/** 姓名        **/
	this.fullName=function(fullName){if(this.proxy)return this.getProxy().fullName(fullName);  this.put("fullName", fullName);return this;};
	/** and full_name is null */
	this.fullNameNull=function(){if(this.proxy)return this.getProxy().fullNameNull();if(this.get("fullNameNot")==null)this.put("fullNameNot", "");this.put("fullName", null);return this;};
	/** not .... */
	this.fullNameNot=function(){if(this.proxy)return this.getProxy().fullNameNot();this.put("fullNameNot", "not");return this;};
	this.fullNameNotNull=function(){if(this.proxy)return this.getProxy().fullNameNotNull();this.put("fullNameNot", "not");this.put("fullName", null);return this;};
	this.fullNameNot=function(fullName){if(this.proxy)return this.getProxy().fullNameNot(fullName);this.put("fullNameNot", "not");this.put("fullName", fullName);return this;};
		
		 
	
	
	/** 贡献人名称        **/
	this.incomersName=function(incomersName){if(this.proxy)return this.getProxy().incomersName(incomersName);  this.put("incomersName", incomersName);return this;};
	/** and incomers_name is null */
	this.incomersNameNull=function(){if(this.proxy)return this.getProxy().incomersNameNull();if(this.get("incomersNameNot")==null)this.put("incomersNameNot", "");this.put("incomersName", null);return this;};
	/** not .... */
	this.incomersNameNot=function(){if(this.proxy)return this.getProxy().incomersNameNot();this.put("incomersNameNot", "not");return this;};
	this.incomersNameNotNull=function(){if(this.proxy)return this.getProxy().incomersNameNotNull();this.put("incomersNameNot", "not");this.put("incomersName", null);return this;};
	this.incomersNameNot=function(incomersName){if(this.proxy)return this.getProxy().incomersNameNot(incomersName);this.put("incomersNameNot", "not");this.put("incomersName", incomersName);return this;};
		
		 
	
	
	/** 收益人姓名        **/
	this.incomerName=function(incomerName){if(this.proxy)return this.getProxy().incomerName(incomerName);  this.put("incomerName", incomerName);return this;};
	/** and incomer_name is null */
	this.incomerNameNull=function(){if(this.proxy)return this.getProxy().incomerNameNull();if(this.get("incomerNameNot")==null)this.put("incomerNameNot", "");this.put("incomerName", null);return this;};
	/** not .... */
	this.incomerNameNot=function(){if(this.proxy)return this.getProxy().incomerNameNot();this.put("incomerNameNot", "not");return this;};
	this.incomerNameNotNull=function(){if(this.proxy)return this.getProxy().incomerNameNotNull();this.put("incomerNameNot", "not");this.put("incomerName", null);return this;};
	this.incomerNameNot=function(incomerName){if(this.proxy)return this.getProxy().incomerNameNot(incomerName);this.put("incomerNameNot", "not");this.put("incomerName", incomerName);return this;};
		
		 
	
	
	/** 贡献人  [Member]      **/
	this.contributor=function(contributor){if(this.proxy)return this.getProxy().contributor(contributor);  this.put("contributor", contributor);return this;};
	/** and contributor is null */
	this.contributorNull=function(){if(this.proxy)return this.getProxy().contributorNull();if(this.get("contributorNot")==null)this.put("contributorNot", "");this.put("contributor", null);return this;};
	/** not .... */
	this.contributorNot=function(){if(this.proxy)return this.getProxy().contributorNot();this.put("contributorNot", "not");return this;};
	this.contributorNotNull=function(){if(this.proxy)return this.getProxy().contributorNotNull();this.put("contributorNot", "not");this.put("contributor", null);return this;};
	this.contributorNot=function(contributor){if(this.proxy)return this.getProxy().contributorNot(contributor);this.put("contributorNot", "not");this.put("contributor", contributor);return this;};
		
		
	this.contributorIn=function(ids){
		if(this.proxy)return this.getProxy().contributorIn(ids);  this.put("contributorIn", ids);return this;
	};	
		 
	
	
	/** 收益人  [Member]      **/
	this.beneficiary=function(beneficiary){if(this.proxy)return this.getProxy().beneficiary(beneficiary);  this.put("beneficiary", beneficiary);return this;};
	/** and beneficiary is null */
	this.beneficiaryNull=function(){if(this.proxy)return this.getProxy().beneficiaryNull();if(this.get("beneficiaryNot")==null)this.put("beneficiaryNot", "");this.put("beneficiary", null);return this;};
	/** not .... */
	this.beneficiaryNot=function(){if(this.proxy)return this.getProxy().beneficiaryNot();this.put("beneficiaryNot", "not");return this;};
	this.beneficiaryNotNull=function(){if(this.proxy)return this.getProxy().beneficiaryNotNull();this.put("beneficiaryNot", "not");this.put("beneficiary", null);return this;};
	this.beneficiaryNot=function(beneficiary){if(this.proxy)return this.getProxy().beneficiaryNot(beneficiary);this.put("beneficiaryNot", "not");this.put("beneficiary", beneficiary);return this;};
		
		
	this.beneficiaryIn=function(ids){
		if(this.proxy)return this.getProxy().beneficiaryIn(ids);  this.put("beneficiaryIn", ids);return this;
	};	
		 
	
	
	/** 订单编号        **/
	this.orderNumber=function(orderNumber){if(this.proxy)return this.getProxy().orderNumber(orderNumber);  this.put("orderNumber", orderNumber);return this;};
	/** and order_number is null */
	this.orderNumberNull=function(){if(this.proxy)return this.getProxy().orderNumberNull();if(this.get("orderNumberNot")==null)this.put("orderNumberNot", "");this.put("orderNumber", null);return this;};
	/** not .... */
	this.orderNumberNot=function(){if(this.proxy)return this.getProxy().orderNumberNot();this.put("orderNumberNot", "not");return this;};
	this.orderNumberNotNull=function(){if(this.proxy)return this.getProxy().orderNumberNotNull();this.put("orderNumberNot", "not");this.put("orderNumber", null);return this;};
	this.orderNumberNot=function(orderNumber){if(this.proxy)return this.getProxy().orderNumberNot(orderNumber);this.put("orderNumberNot", "not");this.put("orderNumber", orderNumber);return this;};
		
		 
	
	
	/** 品牌信息  [Merchant]      **/
	this.brands=function(brands){if(this.proxy)return this.getProxy().brands(brands);  this.put("brands", brands);return this;};
	/** and brands is null */
	this.brandsNull=function(){if(this.proxy)return this.getProxy().brandsNull();if(this.get("brandsNot")==null)this.put("brandsNot", "");this.put("brands", null);return this;};
	/** not .... */
	this.brandsNot=function(){if(this.proxy)return this.getProxy().brandsNot();this.put("brandsNot", "not");return this;};
	this.brandsNotNull=function(){if(this.proxy)return this.getProxy().brandsNotNull();this.put("brandsNot", "not");this.put("brands", null);return this;};
	this.brandsNot=function(brands){if(this.proxy)return this.getProxy().brandsNot(brands);this.put("brandsNot", "not");this.put("brands", brands);return this;};
		
		
	this.brandsIn=function(ids){
		if(this.proxy)return this.getProxy().brandsIn(ids);  this.put("brandsIn", ids);return this;
	};	
		 
	
	
	/** 结算情况    1:待结算 2:已结算     **/
	this.endStatus=function(endStatus){if(this.proxy)return this.getProxy().endStatus(endStatus);  this.put("endStatus", endStatus);return this;};
	/** and end_status is null */
	this.endStatusNull=function(){if(this.proxy)return this.getProxy().endStatusNull();if(this.get("endStatusNot")==null)this.put("endStatusNot", "");this.put("endStatus", null);return this;};
	/** not .... */
	this.endStatusNot=function(){if(this.proxy)return this.getProxy().endStatusNot();this.put("endStatusNot", "not");return this;};
	this.endStatusNotNull=function(){if(this.proxy)return this.getProxy().endStatusNotNull();this.put("endStatusNot", "not");this.put("endStatus", null);return this;};
	this.endStatusNot=function(endStatus){if(this.proxy)return this.getProxy().endStatusNot(endStatus);this.put("endStatusNot", "not");this.put("endStatus", endStatus);return this;};
		
		
	this.endStatusIn=function(ids){
		if(this.proxy)return this.getProxy().endStatusIn(ids);  this.put("endStatusIn", ids);return this;
	};	
		 
	
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
		
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
		
		 
	
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
		
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
		
		 
	
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
		
		
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有会员收益记录 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/finance/incomerecord.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取会员收益记录分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/finance/incomerecord.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取会员收益记录 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/finance/incomerecord.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

IncomeRecord.get = function(id){
	var protocol = ux.ajax("/admin/finance/incomerecord.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.incomeRecord;
	return null;
}

IncomeRecord.where = new IncomeRecord.Where(0,true);